import React from 'react';
import { Typography } from 'antd';
import BizIcon from '@/components/BizIcon';
import { DividerContainer, Icon } from '@/molecules';
import styles from './index.less';

const { Paragraph } = Typography;

const EvaluationItem = ({ title, children, onEdit, onPreview, ...rest }) => (
    <div className={styles.evaluationItemWrap} {...rest}>
        <div className={styles.evaluationItem}>
            <BizIcon type="fujian" style={{ marginRight: 4 }} />
            <Paragraph ellipsis style={{ marginBottom: 0 }} title={children}>
                {children}
            </Paragraph>
        </div>
        <DividerContainer style={{ flexShrink: 0 }}>
            {onEdit && <Icon title="编辑" type="listfunction_edit_icon_default" onClick={onEdit} />}
            {onPreview && <Icon title="预览" type="listfunction_view_icon_default" onClick={onPreview} />}
        </DividerContainer>
    </div>
);

export default EvaluationItem;
